<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%
    boolean login = session.getAttribute("userID") != null;
%>
<header class="header">
    <h2 style="margin: auto 0;">
        23120115洪炜斐——学生管理系统——${param.page}
    </h2>
    <nav class="header-nav">
        <ul class="nav-menu">
            <li>
                <a href="./index.jsp">首页</a>
            </li>
            <li>
                <a href="./admin_major.jsp">专业管理</a>
            </li>
            <li>
                <a href="./admin_job.jsp">职务管理</a>
            </li>
            <li>
                <a href="./admin_class.jsp">班级管理</a>
            </li>
            <li>
                <a href="./admin.jsp">学生管理</a>
            </li>
        </ul>
        <ul class="nav-menu">
            <% if (login) { %>
                <li>
                    <a href="javascript: headerLogout()">退出登录</a>
                </li>
                <li>
                    <a href="./user.jsp">用户中心</a>
                </li>
            <% } else { %>
                <li>
                    <a href="./login.jsp">登录</a>
                </li>
                <li>
                    <a href="./register.jsp">注册</a>
                </li>
            <% } %>
        </ul>
    </nav>
</header>
<script>
    function headerLogout() {
        if (window.confirm("是否退出登录")) {
            window.location.href = "./action/user/logout";
        }
    }
</script>

